package xyz.dagoose.contacts;


public class yanghuiTest {
	public static void main(String[] args) {
		// 1. 声明二维数组
		int[][] yangHui = new int[10][];
		// 2.数组元素赋值
		for (int i =0;i<yangHui.length;++i){
			yangHui[i] = new int[i+1];
			yangHui[i][0] = yangHui[i][i] = 1;
			if (i==1)continue;
			for (int j =1;j<yangHui[i].length - 1;++j){
				yangHui[i][j] = yangHui[i-1][j] + yangHui[i-1][j-1] ;
			}
			
		}
		// 3.遍历输出
		for (int i =0;i<yangHui.length;++i){
			for (int j =0;j<yangHui[i].length;++j){
				System.out.print(yangHui[i][j]+" ");
			}
			System.out.print('\n');
		}
	}
	
}
